package com.fr.base.core.image4j.codec.ico;

import com.fr.base.core.image4j.codec.bmp.BMPImage;
import com.fr.base.core.image4j.codec.bmp.InfoHeader;
import java.awt.image.BufferedImage;

public class ICOImage extends BMPImage
{
  protected IconEntry iconEntry;
  protected boolean pngCompressed = false;
  protected int iconIndex = -1;

  public ICOImage(BufferedImage paramBufferedImage, InfoHeader paramInfoHeader, IconEntry paramIconEntry)
  {
    super(paramBufferedImage, paramInfoHeader);
    this.iconEntry = paramIconEntry;
  }

  public IconEntry getIconEntry()
  {
    return this.iconEntry;
  }

  public void setIconEntry(IconEntry paramIconEntry)
  {
    this.iconEntry = paramIconEntry;
  }

  public boolean isPngCompressed()
  {
    return this.pngCompressed;
  }

  public void setPngCompressed(boolean paramBoolean)
  {
    this.pngCompressed = paramBoolean;
  }

  public InfoHeader getInfoHeader()
  {
    return super.getInfoHeader();
  }

  public int getIconIndex()
  {
    return this.iconIndex;
  }

  public void setIconIndex(int paramInt)
  {
    this.iconIndex = paramInt;
  }

  public int getWidth()
  {
    return ((this.iconEntry.bWidth == 0) ? 256 : (this.iconEntry == null) ? -1 : this.iconEntry.bWidth);
  }

  public int getHeight()
  {
    return ((this.iconEntry.bHeight == 0) ? 256 : (this.iconEntry == null) ? -1 : this.iconEntry.bHeight);
  }

  public int getColourDepth()
  {
    return ((this.iconEntry == null) ? -1 : this.iconEntry.sBitCount);
  }

  public int getColourCount()
  {
    int i = (this.iconEntry.sBitCount == 32) ? 24 : this.iconEntry.sBitCount;
    return ((i == -1) ? -1 : 1 << i);
  }

  public boolean isIndexed()
  {
    return (this.iconEntry != null);
  }
}